package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.QcontrolsMapper;
import com.youlai.boot.system.model.QB.Qcontrols;
import com.youlai.boot.system.service.QcontrolsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class QcontrolsServiceImpl extends ServiceImpl<QcontrolsMapper, Qcontrols> implements QcontrolsService {
    @Autowired
    private QcontrolsMapper qcontrolsMapper;

    @Override
    public boolean saveQcontrols(Qcontrols qcontrols) {
        qcontrols.setAddtime(LocalDateTime.now());
        return save(qcontrols);
    }

    @Override
    public List<Qcontrols> getAllQcontrols() {
        return qcontrolsMapper.selectList(null);
    }

    @Override
    public boolean deleteQcontrolsById(Integer id) {
        return qcontrolsMapper.deleteById(id)>0;
    }
}
